package gamesys.games.particlesystem.effects
{
	import gamesys.games.particlesystem.core.ParticleData;
	import gamesys.games.particlesystem.utils.Range;

	/**
	 * @author robertthurston
	 */
	public class DecayEffect implements IEffect
	{
		private var _decay:Range;

		public function DecayEffect(range:Range)
		{
			_decay = range;
		}

		public function reset(particleData:ParticleData):void
		{
			particleData.decay = _decay.range;
		}

		public function update(particleData:ParticleData):void
		{
			particleData.xSpeed *= particleData.decay;
			particleData.ySpeed *= particleData.decay;
		}
	}
}
